using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Sys_ImageTemp - 已上传图片表 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class ISysImageTemp<T> :ModelBase<SysImageTemp> where T : SysImageTemp, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.RowId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return RowId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.RowId=dy.RowId;
           this.FileId=dy.FileId;
           this.TypeId=dy.TypeId;
           this.ModelId=dy.ModelId;
           this.UpTime=dy.UpTime;
        } 

        #region 定义属性

     
         /// <summary>
        /// 流水ID
        /// </summary>
        private String _RowId = "";
      
        /// <summary>
        /// 流水ID
        /// </summary>
        public String RowId
        {
            get 
            {
              return   (this._RowId); 
            }

            set 
            {
                    _RowId= value;  
            }
        }
       
     
         /// <summary>
        /// 图片ID
        /// </summary>
        private String _FileId = "";
      
        /// <summary>
        /// 图片ID
        /// </summary>
        public String FileId
        {
            get 
            {
              return   (this._FileId); 
            }

            set 
            {
                    _FileId= value;  
            }
        }
       
     
         /// <summary>
        /// 保存类型
        /// </summary>
        private int _TypeId =-1;
      
        /// <summary>
        /// 保存类型
        /// </summary>
        public yq.Enums.SysImageTemp.TypeId TypeId
        {
            get 
            {
              return   (yq.Enums.SysImageTemp.TypeId)this._TypeId;  
            }

            set 
            {
                    _TypeId= value.GetHashCode(); 
            }
        }
       
     
         /// <summary>
        /// 实体ID
        /// </summary>
        private String _ModelId = "";
      
        /// <summary>
        /// 实体ID
        /// </summary>
        public String ModelId
        {
            get 
            {
              return   (this._ModelId); 
            }

            set 
            {
                    _ModelId= value;  
            }
        }
       
     
         /// <summary>
        /// 上传时间
        /// </summary>
        private DateTime _UpTime =DateTime.MinValue;
      
        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime UpTime
        {
            get 
            {
              return   (this._UpTime); 
            }

            set 
            {
                    _UpTime= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(SysImageTemp info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["RowId"]!= DBNull.Value)
                  {
                  info.RowId=row["RowId"].ToString();
                 }
                 
                  
                  if(row["FileId"]!= DBNull.Value)
                  {
                  info.FileId=row["FileId"].ToString();
                 }
                 
                  
                  if(row["TypeId"]!= DBNull.Value)
                  {
                  info.TypeId=  (yq.Enums.SysImageTemp.TypeId)(row["TypeId"]) ;
                 }
                 
                  
                  if(row["ModelId"]!= DBNull.Value)
                  {
                  info.ModelId=row["ModelId"].ToString();
                 }
                 
                  
                  if(row["UpTime"]!= DBNull.Value)
                  {
                  info.UpTime=Convert.ToDateTime(row["UpTime"]);
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, SysImageTemp info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@RowId", DbType.String,ParameterTool.GetObj( info._RowId )); 
            
             
                cn.AddInParameter(comm, "@FileId", DbType.String,ParameterTool.GetObj( info._FileId )); 
            
             
                cn.AddInParameter(comm, "@TypeId", DbType.Int32,ParameterTool.GetObj( info._TypeId )); 
            
             
                cn.AddInParameter(comm, "@ModelId", DbType.String,ParameterTool.GetObj( info._ModelId )); 
            
             
                cn.AddInParameter(comm, "@UpTime", DbType.DateTime,ParameterTool.GetObj( info._UpTime )); 
            
        } 

    } 
} 